package com.prothink.entity;

/**
 * @ClassName : RequestData  //类名
 * @Description : 返回类型  //描述
 * @Author : Zhang //作者
 * @Date: 11/21  11:04
 */
public class RequestData {
    private int code;
    private String msg;
    private Integer count;
    private Object data;

    public static RequestData buildSuccess(Object data){
        return new RequestData(200,"",data);
    }
    public static RequestData success(){
        return new RequestData(200,"");
    }

    public static RequestData buildSuccess(Object data, Integer count){
        return new RequestData(200,"",data,count);
    }

    public static RequestData buildError(String msg){
        return new RequestData(400,msg);
    }

    private RequestData() {
        super();
    }

    private RequestData(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    private RequestData(int code, String msg, Object data, Integer count) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.count = count;
    }

    private RequestData(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private RequestData(int code, String msg, Integer count) {
        this.code = code;
        this.msg = msg;
        this.count = count;
    }

    private RequestData(int code, String msg, Integer count, Object data) {
        this.code = code;
        this.msg = msg;
        this.count = count;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "RequestData{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", count=" + count +
                ", data=" + data +
                '}';
    }
}
